﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_LH_YONGHUBF实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class YS_LH_YONGHUBF
    {
        private double? m_db_n_beiyong11;

        private double? m_db_n_beiyong12;

        private double? m_db_n_ysj;

        private decimal? m_dec_i_beiyong10;

        private decimal? m_dec_i_beiyong6;

        private decimal? m_dec_i_beiyong7;

        private decimal? m_dec_i_beiyong8;

        private decimal? m_dec_i_beiyong9;

        private decimal? m_dec_i_chennuoff;

        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_kaohefy;

        private decimal? m_dec_i_laihanlx;

        private decimal? m_dec_i_leixing;

        private decimal? m_dec_i_shikaohy;

        private decimal? m_dec_i_shoufeifs;

        private decimal? m_dec_i_yonghuzt;

        private decimal m_dec_id;

        private DateTime? m_DT_d_caozuosj;

        private DateTime? m_DT_d_hujixgrq;

        private DateTime? m_DT_d_lihurq;

        private DateTime? m_DT_d_xiugairq;

        private string m_str_s_beiyong1;

        private string m_str_s_beiyong2;

        private string m_str_s_beiyong3;

        private string m_str_s_beiyong4;

        private string m_str_s_beiyong5;

        private string m_str_s_beizhu;

        private string m_str_s_caiwudz;

        private string m_str_s_caiwuyb;

        private string m_str_s_caozuor;

        private string m_str_s_dizhi;

        private string m_str_s_gongsibh;

        private string m_str_s_guanlikbh;

        private string m_str_s_jubianh;

        private string m_str_s_kaihuhm;

        private string m_str_s_kaihuyh;

        private string m_str_s_laihanbh;

        private string m_str_s_lianxibm;

        private string m_str_s_lianxidh;

        private string m_str_s_lianxir;

        private string m_str_s_sheshuidxdm;

        private string m_str_s_xingzhengqbh;

        private string m_str_s_xiugair;

        private string m_str_s_yewuy;

        private string m_str_s_yinhangfk;

        private string m_str_s_yinhangzh;

        private string m_str_s_yonghuh;

        private string m_str_s_yonghum;

        private string m_str_s_yongshuixz;

        private string m_str_s_youbian;

        private string m_str_s_yuanyonghuh;

        private string m_str_s_zhandianbh;

        /// <summary>
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        /// </summary>
        public string S_YONGHUH
        {
            get { return m_str_s_yonghuh; }
            set { m_str_s_yonghuh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_ZHANDIANBH
        {
            get { return m_str_s_zhandianbh; }
            set { m_str_s_zhandianbh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_GUANLIKBH
        {
            get { return m_str_s_guanlikbh; }
            set { m_str_s_guanlikbh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_XINGZHENGQBH
        {
            get { return m_str_s_xingzhengqbh; }
            set { m_str_s_xingzhengqbh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_JUBIANH
        {
            get { return m_str_s_jubianh; }
            set { m_str_s_jubianh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_GONGSIBH
        {
            get { return m_str_s_gongsibh; }
            set { m_str_s_gongsibh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_YONGHUM
        {
            get { return m_str_s_yonghum; }
            set { m_str_s_yonghum = value; }
        }

        /// <summary>
        /// </summary>
        public string S_DIZHI
        {
            get { return m_str_s_dizhi; }
            set { m_str_s_dizhi = value; }
        }

        /// <summary>
        /// </summary>
        public string S_YOUBIAN
        {
            get { return m_str_s_youbian; }
            set { m_str_s_youbian = value; }
        }

        /// <summary>
        /// </summary>
        public string S_LIANXIBM
        {
            get { return m_str_s_lianxibm; }
            set { m_str_s_lianxibm = value; }
        }

        /// <summary>
        /// </summary>
        public string S_LIANXIR
        {
            get { return m_str_s_lianxir; }
            set { m_str_s_lianxir = value; }
        }

        /// <summary>
        /// </summary>
        public string S_LIANXIDH
        {
            get { return m_str_s_lianxidh; }
            set { m_str_s_lianxidh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_YINHANGZH
        {
            get { return m_str_s_yinhangzh; }
            set { m_str_s_yinhangzh = value; }
        }

        /// <summary>
        /// </summary>
        public string S_KAIHUHM
        {
            get { return m_str_s_kaihuhm; }
            set { m_str_s_kaihuhm = value; }
        }

        /// <summary>
        /// </summary>
        public string S_KAIHUYH
        {
            get { return m_str_s_kaihuyh; }
            set { m_str_s_kaihuyh = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SHOUFEIFS
        {
            get { return m_dec_i_shoufeifs; }
            set { m_dec_i_shoufeifs = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_CHENNUOFF
        {
            get { return m_dec_i_chennuoff; }
            set { m_dec_i_chennuoff = value; }
        }

        /// <summary>
        /// </summary>
        public string S_YONGSHUIXZ
        {
            get { return m_str_s_yongshuixz; }
            set { m_str_s_yongshuixz = value; }
        }

        /// <summary>
        /// </summary>
        public string S_SHESHUIDXDM
        {
            get { return m_str_s_sheshuidxdm; }
            set { m_str_s_sheshuidxdm = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_KAOHEFY
        {
            get { return m_dec_i_kaohefy; }
            set { m_dec_i_kaohefy = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SHIKAOHY
        {
            get { return m_dec_i_shikaohy; }
            set { m_dec_i_shikaohy = value; }
        }

        /// <summary>
        /// </summary>
        public string S_YEWUY
        {
            get { return m_str_s_yewuy; }
            set { m_str_s_yewuy = value; }
        }

        /// <summary>
        /// </summary>
        public double? N_YSJ
        {
            get { return m_db_n_ysj; }
            set { m_db_n_ysj = value; }
        }

        /// <summary>
        /// </summary>
        public string S_YUANYONGHUH
        {
            get { return m_str_s_yuanyonghuh; }
            set { m_str_s_yuanyonghuh = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_YONGHUZT
        {
            get { return m_dec_i_yonghuzt; }
            set { m_dec_i_yonghuzt = value; }
        }

        /// <summary>
        /// </summary>
        public DateTime? D_XIUGAIRQ
        {
            get { return m_DT_d_xiugairq; }
            set { m_DT_d_xiugairq = value; }
        }

        /// <summary>
        /// </summary>
        public DateTime? D_LIHURQ
        {
            get { return m_DT_d_lihurq; }
            set { m_DT_d_lihurq = value; }
        }

        /// <summary>
        /// </summary>
        public DateTime? D_HUJIXGRQ
        {
            get { return m_DT_d_hujixgrq; }
            set { m_DT_d_hujixgrq = value; }
        }

        /// <summary>
        /// </summary>
        public string S_XIUGAIR
        {
            get { return m_str_s_xiugair; }
            set { m_str_s_xiugair = value; }
        }

        /// <summary>
        /// </summary>
        public string S_BEIZHU
        {
            get { return m_str_s_beizhu; }
            set { m_str_s_beizhu = value; }
        }

        /// <summary>
        /// </summary>
        public string S_YINHANGFK
        {
            get { return m_str_s_yinhangfk; }
            set { m_str_s_yinhangfk = value; }
        }

        /// <summary>
        /// </summary>
        public string S_CAIWUDZ
        {
            get { return m_str_s_caiwudz; }
            set { m_str_s_caiwudz = value; }
        }

        /// <summary>
        /// </summary>
        public string S_CAIWUYB
        {
            get { return m_str_s_caiwuyb; }
            set { m_str_s_caiwuyb = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_LEIXING
        {
            get { return m_dec_i_leixing; }
            set { m_dec_i_leixing = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }

        /// <summary>
        /// </summary>
        public DateTime? D_CAOZUOSJ
        {
            get { return m_DT_d_caozuosj; }
            set { m_DT_d_caozuosj = value; }
        }

        /// <summary>
        /// </summary>
        public string S_BEIYONG1
        {
            get { return m_str_s_beiyong1; }
            set { m_str_s_beiyong1 = value; }
        }

        /// <summary>
        /// </summary>
        public string S_BEIYONG2
        {
            get { return m_str_s_beiyong2; }
            set { m_str_s_beiyong2 = value; }
        }

        /// <summary>
        /// </summary>
        public string S_BEIYONG3
        {
            get { return m_str_s_beiyong3; }
            set { m_str_s_beiyong3 = value; }
        }

        /// <summary>
        /// </summary>
        public string S_BEIYONG4
        {
            get { return m_str_s_beiyong4; }
            set { m_str_s_beiyong4 = value; }
        }

        /// <summary>
        /// </summary>
        public string S_BEIYONG5
        {
            get { return m_str_s_beiyong5; }
            set { m_str_s_beiyong5 = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_BEIYONG6
        {
            get { return m_dec_i_beiyong6; }
            set { m_dec_i_beiyong6 = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_BEIYONG7
        {
            get { return m_dec_i_beiyong7; }
            set { m_dec_i_beiyong7 = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_BEIYONG8
        {
            get { return m_dec_i_beiyong8; }
            set { m_dec_i_beiyong8 = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_BEIYONG9
        {
            get { return m_dec_i_beiyong9; }
            set { m_dec_i_beiyong9 = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_BEIYONG10
        {
            get { return m_dec_i_beiyong10; }
            set { m_dec_i_beiyong10 = value; }
        }

        /// <summary>
        /// </summary>
        public double? N_BEIYONG11
        {
            get { return m_db_n_beiyong11; }
            set { m_db_n_beiyong11 = value; }
        }

        /// <summary>
        /// </summary>
        public double? N_BEIYONG12
        {
            get { return m_db_n_beiyong12; }
            set { m_db_n_beiyong12 = value; }
        }

        /// <summary>
        /// </summary>
        public string S_LAIHANBH
        {
            get { return m_str_s_laihanbh; }
            set { m_str_s_laihanbh = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_LAIHANLX
        {
            get { return m_dec_i_laihanlx; }
            set { m_dec_i_laihanlx = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class YS_LH_YONGHUBFProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public YS_LH_YONGHUBFProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据YS_LH_YONGHUBF实体添加或者修改YS_LH_YONGHUBF信息
        /// </summary>
        public bool InsertOrUpdate(YS_LH_YONGHUBF YS_LH_YONGHUBF, OracleTransaction Transaction)
        {
            if (YS_LH_YONGHUBF.ID == 0)
                InsertYS_LH_YONGHUBF(YS_LH_YONGHUBF, Transaction);
            else
                UpdateYS_LH_YONGHUBF(YS_LH_YONGHUBF, Transaction);
            return YS_LH_YONGHUBF.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_LH_YONGHUBF实体添加或修改YS_LH_YONGHUBF信息
        /// </summary>
        public bool InsertOrUpdate(YS_LH_YONGHUBF YS_LH_YONGHUBF)
        {
            return InsertOrUpdate(YS_LH_YONGHUBF, null);
        }


        /// <summary>
        ///     根据YS_LH_YONGHUBF主键删除YS_LH_YONGHUBF信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_LH_YONGHUBF(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_LH_YONGHUBF";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_LH_YONGHUBF主键删除YS_LH_YONGHUBF信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_LH_YONGHUBF(decimal ID)
        {
            return DeleteYS_LH_YONGHUBF(ID, null);
        }

        /// <summary>
        ///     根据条件删除YS_LH_YONGHUBF信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_LH_YONGHUBFsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_LH_YONGHUBFsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除YS_LH_YONGHUBF信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_LH_YONGHUBFsDynamic(string WhereClause)
        {
            return DeleteYS_LH_YONGHUBFsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据YS_LH_YONGHUBF主键选择YS_LH_YONGHUBF信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_LH_YONGHUBF信息</returns>
        public YS_LH_YONGHUBF SelectYS_LH_YONGHUBF(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_LH_YONGHUBF";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var YS_LH_YONGHUBF = PopulateYS_LH_YONGHUBF(rd);
                rd.Close();
                return YS_LH_YONGHUBF;
            }
            return null;
        }

        /// <summary>
        ///     根据YS_LH_YONGHUBF主键选择YS_LH_YONGHUBF信息
        /// </summary>
        /// <returns>YS_LH_YONGHUBF信息</returns>
        public YS_LH_YONGHUBF SelectYS_LH_YONGHUBF(decimal ID)
        {
            return SelectYS_LH_YONGHUBF(ID, null);
        }

        /// <summary>
        ///     选择所有YS_LH_YONGHUBF信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_LH_YONGHUBF信息</returns>
        public DataTable SelectYS_LH_YONGHUBFsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_LH_YONGHUBFsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有YS_LH_YONGHUBF信息
        /// </summary>
        /// <returns>所有YS_LH_YONGHUBF信息</returns>
        public DataTable SelectYS_LH_YONGHUBFsAll()
        {
            return SelectYS_LH_YONGHUBFsAll(null);
        }

        /// <summary>
        ///     根据条件选择YS_LH_YONGHUBF信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_LH_YONGHUBF信息</returns>
        public DataTable SelectYS_LH_YONGHUBFsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_LH_YONGHUBFsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_LH_YONGHUBF信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_LH_YONGHUBF信息</returns>
        public DataTable SelectYS_LH_YONGHUBFsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_LH_YONGHUBFsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择YS_LH_YONGHUBF信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_LH_YONGHUBF信息</returns>
        public DataTable SelectYS_LH_YONGHUBFsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_LH_YONGHUBFsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_LH_YONGHUBF信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_LH_YONGHUBF信息</returns>
        public DataTable SelectYS_LH_YONGHUBFsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectYS_LH_YONGHUBFsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新YS_LH_YONGHUBF字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_LH_YONGHUBFsDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdYS_LH_YONGHUBFDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新YS_LH_YONGHUBF字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_LH_YONGHUBFsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_LH_YONGHUBFsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertYS_LH_YONGHUBF(YS_LH_YONGHUBF YS_LH_YONGHUBF, OracleTransaction Transaction)
        {
            var spName = "CS_InsYS_LH_YONGHUBF";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_LH_YONGHUBF.S_YONGHUH;
            storedParams[1].Value = YS_LH_YONGHUBF.S_ZHANDIANBH;
            storedParams[2].Value = YS_LH_YONGHUBF.S_GUANLIKBH;
            storedParams[3].Value = YS_LH_YONGHUBF.S_XINGZHENGQBH;
            storedParams[4].Value = YS_LH_YONGHUBF.S_JUBIANH;
            storedParams[5].Value = YS_LH_YONGHUBF.S_GONGSIBH;
            storedParams[6].Value = YS_LH_YONGHUBF.S_YONGHUM;
            storedParams[7].Value = YS_LH_YONGHUBF.S_DIZHI;
            storedParams[8].Value = YS_LH_YONGHUBF.S_YOUBIAN;
            storedParams[9].Value = YS_LH_YONGHUBF.S_LIANXIBM;
            storedParams[10].Value = YS_LH_YONGHUBF.S_LIANXIR;
            storedParams[11].Value = YS_LH_YONGHUBF.S_LIANXIDH;
            storedParams[12].Value = YS_LH_YONGHUBF.S_YINHANGZH;
            storedParams[13].Value = YS_LH_YONGHUBF.S_KAIHUHM;
            storedParams[14].Value = YS_LH_YONGHUBF.S_KAIHUYH;
            storedParams[15].Value = YS_LH_YONGHUBF.I_SHOUFEIFS;
            storedParams[16].Value = YS_LH_YONGHUBF.I_CHENNUOFF;
            storedParams[17].Value = YS_LH_YONGHUBF.S_YONGSHUIXZ;
            storedParams[18].Value = YS_LH_YONGHUBF.S_SHESHUIDXDM;
            storedParams[19].Value = YS_LH_YONGHUBF.I_KAOHEFY;
            storedParams[20].Value = YS_LH_YONGHUBF.I_SHIKAOHY;
            storedParams[21].Value = YS_LH_YONGHUBF.S_YEWUY;
            storedParams[22].Value = YS_LH_YONGHUBF.N_YSJ;
            storedParams[23].Value = YS_LH_YONGHUBF.S_YUANYONGHUH;
            storedParams[24].Value = YS_LH_YONGHUBF.I_YONGHUZT;
            storedParams[25].Value = YS_LH_YONGHUBF.D_XIUGAIRQ;
            storedParams[26].Value = YS_LH_YONGHUBF.D_LIHURQ;
            storedParams[27].Value = YS_LH_YONGHUBF.D_HUJIXGRQ;
            storedParams[28].Value = YS_LH_YONGHUBF.S_XIUGAIR;
            storedParams[29].Value = YS_LH_YONGHUBF.S_BEIZHU;
            storedParams[30].Value = YS_LH_YONGHUBF.S_YINHANGFK;
            storedParams[31].Value = YS_LH_YONGHUBF.S_CAIWUDZ;
            storedParams[32].Value = YS_LH_YONGHUBF.S_CAIWUYB;
            storedParams[33].Value = YS_LH_YONGHUBF.I_LEIXING;
            storedParams[34].Value = YS_LH_YONGHUBF.I_JLZT;
            storedParams[35].Value = YS_LH_YONGHUBF.S_CAOZUOR;
            storedParams[36].Value = YS_LH_YONGHUBF.D_CAOZUOSJ;
            storedParams[37].Value = YS_LH_YONGHUBF.S_BEIYONG1;
            storedParams[38].Value = YS_LH_YONGHUBF.S_BEIYONG2;
            storedParams[39].Value = YS_LH_YONGHUBF.S_BEIYONG3;
            storedParams[40].Value = YS_LH_YONGHUBF.S_BEIYONG4;
            storedParams[41].Value = YS_LH_YONGHUBF.S_BEIYONG5;
            storedParams[42].Value = YS_LH_YONGHUBF.I_BEIYONG6;
            storedParams[43].Value = YS_LH_YONGHUBF.I_BEIYONG7;
            storedParams[44].Value = YS_LH_YONGHUBF.I_BEIYONG8;
            storedParams[45].Value = YS_LH_YONGHUBF.I_BEIYONG9;
            storedParams[46].Value = YS_LH_YONGHUBF.I_BEIYONG10;
            storedParams[47].Value = YS_LH_YONGHUBF.N_BEIYONG11;
            storedParams[48].Value = YS_LH_YONGHUBF.N_BEIYONG12;
            storedParams[49].Value = YS_LH_YONGHUBF.S_LAIHANBH;
            storedParams[50].Value = YS_LH_YONGHUBF.I_LAIHANLX;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_LH_YONGHUBF.ID = Convert.ToInt32(storedParams[51].Value);
            return result;
        }

        private bool UpdateYS_LH_YONGHUBF(YS_LH_YONGHUBF YS_LH_YONGHUBF, OracleTransaction Transaction)
        {
            var spName = "CS_UpdYS_LH_YONGHUBF";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_LH_YONGHUBF.S_YONGHUH;
            storedParams[1].Value = YS_LH_YONGHUBF.S_ZHANDIANBH;
            storedParams[2].Value = YS_LH_YONGHUBF.S_GUANLIKBH;
            storedParams[3].Value = YS_LH_YONGHUBF.S_XINGZHENGQBH;
            storedParams[4].Value = YS_LH_YONGHUBF.S_JUBIANH;
            storedParams[5].Value = YS_LH_YONGHUBF.S_GONGSIBH;
            storedParams[6].Value = YS_LH_YONGHUBF.S_YONGHUM;
            storedParams[7].Value = YS_LH_YONGHUBF.S_DIZHI;
            storedParams[8].Value = YS_LH_YONGHUBF.S_YOUBIAN;
            storedParams[9].Value = YS_LH_YONGHUBF.S_LIANXIBM;
            storedParams[10].Value = YS_LH_YONGHUBF.S_LIANXIR;
            storedParams[11].Value = YS_LH_YONGHUBF.S_LIANXIDH;
            storedParams[12].Value = YS_LH_YONGHUBF.S_YINHANGZH;
            storedParams[13].Value = YS_LH_YONGHUBF.S_KAIHUHM;
            storedParams[14].Value = YS_LH_YONGHUBF.S_KAIHUYH;
            storedParams[15].Value = YS_LH_YONGHUBF.I_SHOUFEIFS;
            storedParams[16].Value = YS_LH_YONGHUBF.I_CHENNUOFF;
            storedParams[17].Value = YS_LH_YONGHUBF.S_YONGSHUIXZ;
            storedParams[18].Value = YS_LH_YONGHUBF.S_SHESHUIDXDM;
            storedParams[19].Value = YS_LH_YONGHUBF.I_KAOHEFY;
            storedParams[20].Value = YS_LH_YONGHUBF.I_SHIKAOHY;
            storedParams[21].Value = YS_LH_YONGHUBF.S_YEWUY;
            storedParams[22].Value = YS_LH_YONGHUBF.N_YSJ;
            storedParams[23].Value = YS_LH_YONGHUBF.S_YUANYONGHUH;
            storedParams[24].Value = YS_LH_YONGHUBF.I_YONGHUZT;
            storedParams[25].Value = YS_LH_YONGHUBF.D_XIUGAIRQ;
            storedParams[26].Value = YS_LH_YONGHUBF.D_LIHURQ;
            storedParams[27].Value = YS_LH_YONGHUBF.D_HUJIXGRQ;
            storedParams[28].Value = YS_LH_YONGHUBF.S_XIUGAIR;
            storedParams[29].Value = YS_LH_YONGHUBF.S_BEIZHU;
            storedParams[30].Value = YS_LH_YONGHUBF.S_YINHANGFK;
            storedParams[31].Value = YS_LH_YONGHUBF.S_CAIWUDZ;
            storedParams[32].Value = YS_LH_YONGHUBF.S_CAIWUYB;
            storedParams[33].Value = YS_LH_YONGHUBF.I_LEIXING;
            storedParams[34].Value = YS_LH_YONGHUBF.I_JLZT;
            storedParams[35].Value = YS_LH_YONGHUBF.S_CAOZUOR;
            storedParams[36].Value = YS_LH_YONGHUBF.D_CAOZUOSJ;
            storedParams[37].Value = YS_LH_YONGHUBF.S_BEIYONG1;
            storedParams[38].Value = YS_LH_YONGHUBF.S_BEIYONG2;
            storedParams[39].Value = YS_LH_YONGHUBF.S_BEIYONG3;
            storedParams[40].Value = YS_LH_YONGHUBF.S_BEIYONG4;
            storedParams[41].Value = YS_LH_YONGHUBF.S_BEIYONG5;
            storedParams[42].Value = YS_LH_YONGHUBF.I_BEIYONG6;
            storedParams[43].Value = YS_LH_YONGHUBF.I_BEIYONG7;
            storedParams[44].Value = YS_LH_YONGHUBF.I_BEIYONG8;
            storedParams[45].Value = YS_LH_YONGHUBF.I_BEIYONG9;
            storedParams[46].Value = YS_LH_YONGHUBF.I_BEIYONG10;
            storedParams[47].Value = YS_LH_YONGHUBF.N_BEIYONG11;
            storedParams[48].Value = YS_LH_YONGHUBF.N_BEIYONG12;
            storedParams[49].Value = YS_LH_YONGHUBF.S_LAIHANBH;
            storedParams[50].Value = YS_LH_YONGHUBF.I_LAIHANLX;
            storedParams[51].Value = YS_LH_YONGHUBF.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_LH_YONGHUBF PopulateYS_LH_YONGHUBF(IDataReader dr)
        {
            var YS_LH_YONGHUBF = new YS_LH_YONGHUBF();
            YS_LH_YONGHUBF.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            YS_LH_YONGHUBF.S_YONGHUH = dr["S_YONGHUH"] == DBNull.Value ? null : (string) dr["S_YONGHUH"];
            YS_LH_YONGHUBF.S_ZHANDIANBH = dr["S_ZHANDIANBH"] == DBNull.Value ? null : (string) dr["S_ZHANDIANBH"];
            YS_LH_YONGHUBF.S_GUANLIKBH = dr["S_GUANLIKBH"] == DBNull.Value ? null : (string) dr["S_GUANLIKBH"];
            YS_LH_YONGHUBF.S_XINGZHENGQBH = dr["S_XINGZHENGQBH"] == DBNull.Value ? null : (string) dr["S_XINGZHENGQBH"];
            YS_LH_YONGHUBF.S_JUBIANH = dr["S_JUBIANH"] == DBNull.Value ? null : (string) dr["S_JUBIANH"];
            YS_LH_YONGHUBF.S_GONGSIBH = dr["S_GONGSIBH"] == DBNull.Value ? null : (string) dr["S_GONGSIBH"];
            YS_LH_YONGHUBF.S_YONGHUM = dr["S_YONGHUM"] == DBNull.Value ? null : (string) dr["S_YONGHUM"];
            YS_LH_YONGHUBF.S_DIZHI = dr["S_DIZHI"] == DBNull.Value ? null : (string) dr["S_DIZHI"];
            YS_LH_YONGHUBF.S_YOUBIAN = dr["S_YOUBIAN"] == DBNull.Value ? null : (string) dr["S_YOUBIAN"];
            YS_LH_YONGHUBF.S_LIANXIBM = dr["S_LIANXIBM"] == DBNull.Value ? null : (string) dr["S_LIANXIBM"];
            YS_LH_YONGHUBF.S_LIANXIR = dr["S_LIANXIR"] == DBNull.Value ? null : (string) dr["S_LIANXIR"];
            YS_LH_YONGHUBF.S_LIANXIDH = dr["S_LIANXIDH"] == DBNull.Value ? null : (string) dr["S_LIANXIDH"];
            YS_LH_YONGHUBF.S_YINHANGZH = dr["S_YINHANGZH"] == DBNull.Value ? null : (string) dr["S_YINHANGZH"];
            YS_LH_YONGHUBF.S_KAIHUHM = dr["S_KAIHUHM"] == DBNull.Value ? null : (string) dr["S_KAIHUHM"];
            YS_LH_YONGHUBF.S_KAIHUYH = dr["S_KAIHUYH"] == DBNull.Value ? null : (string) dr["S_KAIHUYH"];
            YS_LH_YONGHUBF.I_SHOUFEIFS = dr["I_SHOUFEIFS"] == DBNull.Value ? null : (decimal?) dr["I_SHOUFEIFS"];
            YS_LH_YONGHUBF.I_CHENNUOFF = dr["I_CHENNUOFF"] == DBNull.Value ? null : (decimal?) dr["I_CHENNUOFF"];
            YS_LH_YONGHUBF.S_YONGSHUIXZ = dr["S_YONGSHUIXZ"] == DBNull.Value ? null : (string) dr["S_YONGSHUIXZ"];
            YS_LH_YONGHUBF.S_SHESHUIDXDM = dr["S_SHESHUIDXDM"] == DBNull.Value ? null : (string) dr["S_SHESHUIDXDM"];
            YS_LH_YONGHUBF.I_KAOHEFY = dr["I_KAOHEFY"] == DBNull.Value ? null : (decimal?) dr["I_KAOHEFY"];
            YS_LH_YONGHUBF.I_SHIKAOHY = dr["I_SHIKAOHY"] == DBNull.Value ? null : (decimal?) dr["I_SHIKAOHY"];
            YS_LH_YONGHUBF.S_YEWUY = dr["S_YEWUY"] == DBNull.Value ? null : (string) dr["S_YEWUY"];
            YS_LH_YONGHUBF.N_YSJ = dr["N_YSJ"] == DBNull.Value ? null : (double?) dr["N_YSJ"];
            YS_LH_YONGHUBF.S_YUANYONGHUH = dr["S_YUANYONGHUH"] == DBNull.Value ? null : (string) dr["S_YUANYONGHUH"];
            YS_LH_YONGHUBF.I_YONGHUZT = dr["I_YONGHUZT"] == DBNull.Value ? null : (decimal?) dr["I_YONGHUZT"];
            YS_LH_YONGHUBF.D_XIUGAIRQ = dr["D_XIUGAIRQ"] == DBNull.Value ? null : (DateTime?) dr["D_XIUGAIRQ"];
            YS_LH_YONGHUBF.D_LIHURQ = dr["D_LIHURQ"] == DBNull.Value ? null : (DateTime?) dr["D_LIHURQ"];
            YS_LH_YONGHUBF.D_HUJIXGRQ = dr["D_HUJIXGRQ"] == DBNull.Value ? null : (DateTime?) dr["D_HUJIXGRQ"];
            YS_LH_YONGHUBF.S_XIUGAIR = dr["S_XIUGAIR"] == DBNull.Value ? null : (string) dr["S_XIUGAIR"];
            YS_LH_YONGHUBF.S_BEIZHU = dr["S_BEIZHU"] == DBNull.Value ? null : (string) dr["S_BEIZHU"];
            YS_LH_YONGHUBF.S_YINHANGFK = dr["S_YINHANGFK"] == DBNull.Value ? null : (string) dr["S_YINHANGFK"];
            YS_LH_YONGHUBF.S_CAIWUDZ = dr["S_CAIWUDZ"] == DBNull.Value ? null : (string) dr["S_CAIWUDZ"];
            YS_LH_YONGHUBF.S_CAIWUYB = dr["S_CAIWUYB"] == DBNull.Value ? null : (string) dr["S_CAIWUYB"];
            YS_LH_YONGHUBF.I_LEIXING = dr["I_LEIXING"] == DBNull.Value ? null : (decimal?) dr["I_LEIXING"];
            YS_LH_YONGHUBF.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            YS_LH_YONGHUBF.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            YS_LH_YONGHUBF.D_CAOZUOSJ = dr["D_CAOZUOSJ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUOSJ"];
            YS_LH_YONGHUBF.S_BEIYONG1 = dr["S_BEIYONG1"] == DBNull.Value ? null : (string) dr["S_BEIYONG1"];
            YS_LH_YONGHUBF.S_BEIYONG2 = dr["S_BEIYONG2"] == DBNull.Value ? null : (string) dr["S_BEIYONG2"];
            YS_LH_YONGHUBF.S_BEIYONG3 = dr["S_BEIYONG3"] == DBNull.Value ? null : (string) dr["S_BEIYONG3"];
            YS_LH_YONGHUBF.S_BEIYONG4 = dr["S_BEIYONG4"] == DBNull.Value ? null : (string) dr["S_BEIYONG4"];
            YS_LH_YONGHUBF.S_BEIYONG5 = dr["S_BEIYONG5"] == DBNull.Value ? null : (string) dr["S_BEIYONG5"];
            YS_LH_YONGHUBF.I_BEIYONG6 = dr["I_BEIYONG6"] == DBNull.Value ? null : (decimal?) dr["I_BEIYONG6"];
            YS_LH_YONGHUBF.I_BEIYONG7 = dr["I_BEIYONG7"] == DBNull.Value ? null : (decimal?) dr["I_BEIYONG7"];
            YS_LH_YONGHUBF.I_BEIYONG8 = dr["I_BEIYONG8"] == DBNull.Value ? null : (decimal?) dr["I_BEIYONG8"];
            YS_LH_YONGHUBF.I_BEIYONG9 = dr["I_BEIYONG9"] == DBNull.Value ? null : (decimal?) dr["I_BEIYONG9"];
            YS_LH_YONGHUBF.I_BEIYONG10 = dr["I_BEIYONG10"] == DBNull.Value ? null : (decimal?) dr["I_BEIYONG10"];
            YS_LH_YONGHUBF.N_BEIYONG11 = dr["N_BEIYONG11"] == DBNull.Value ? null : (double?) dr["N_BEIYONG11"];
            YS_LH_YONGHUBF.N_BEIYONG12 = dr["N_BEIYONG12"] == DBNull.Value ? null : (double?) dr["N_BEIYONG12"];
            YS_LH_YONGHUBF.S_LAIHANBH = dr["S_LAIHANBH"] == DBNull.Value ? null : (string) dr["S_LAIHANBH"];
            YS_LH_YONGHUBF.I_LAIHANLX = dr["I_LAIHANLX"] == DBNull.Value ? null : (decimal?) dr["I_LAIHANLX"];
            return YS_LH_YONGHUBF;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion